IF OBJECT_ID('dbo.GetProposalStatuses') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.GetProposalStatuses
    IF OBJECT_ID('dbo.GetProposalStatuses') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.GetProposalStatuses >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.GetProposalStatuses >>>'
END
go
-- =======================================================================
-- Procedure Name: dbo.GetProposalStatuses
--
-- Author:      Kevin Cashman, Parallax Consulting LLC
--
-- Create date: 5/24/2007
--
-- Description: Returns list of ProposalStatuses from dbo.AgrAgreementStatusType
--
-- Parameters:  None
--              
-- Returns:     INT, 0=Success, -1=Error
--
-- SampleCall:
-- EXECUTE dbo.GetProposalStatuses()
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 7/11/07     KC        Created
-- 8/15/07     KC        Permissions
--
-- =======================================================================
CREATE PROCEDURE dbo.GetProposalStatuses
 
AS
BEGIN
     /*  Returned Fields for Dropdown
     --------------------------------
     PersonId            INT
     ManagerName         VARCHAR             
     RecomAbstractId     VARCHAR
     */

     -- Initial Settings
     SET NOCOUNT ON
     
     -- Declare Local Variables
     DECLARE   @Error            INT,
               @RowCount         INT
               
     -- Result Query    Use UDF Table to Limit Results. 
     --                 Also, PostAwardManager is not a "Role" per se
     SELECT Id,
            Name
     FROM   dbo.AgrAgreementStatusType
     ORDER BY Name
     
     SELECT @Error=@@ERROR,@RowCount=@@ROWCOUNT
     IF @Error!=0
          RETURN -1

     -- Return Success
     RETURN 0
     
END
go

IF OBJECT_ID('dbo.GetProposalStatuses') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.GetProposalStatuses >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.GetProposalStatuses >>>'
go

GRANT EXECUTE ON dbo.GetProposalStatuses TO InsightReport,Insight
go
